package com.four.hospital.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.four.hospital.dao.DepartDao;
import com.four.hospital.entity.Depart;
import com.four.hospital.service.DepartService;
import com.four.hospital.vo.DepartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author:wsy
 * @Date: 2022/01/05/15:41
 * @Description
 */
@Service
public class DepartServiceImpl implements DepartService {

    @Autowired
    private DepartDao departDao;

    /**
     * 根据医院id分页模糊查寻科室
     * @param page
     * @param size
     * @param vo
     * @return
     */
    @Override
    public IPage<DepartVo> departList(Integer page, Integer size, DepartVo vo,Integer hosId) {
        Page<Depart> departPage=new Page<>(page,size);
        return departDao.departList(departPage,vo,hosId);
    }

    /**
     * 输入科室名称查询科室信息
     * @param depName
     * @return
     */
    @Override
    public Depart getDepartByName(String depName) {
        return departDao.getDepartByName(depName);
    }

    /**
     * 查询所有科室
     * @return
     */
    @Override
    public List<Depart> getDepartAll() {
        return departDao.getDepartAll();
    }
}
